<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加商品到订单中</title>
    <link rel="stylesheet" href="../lib/layui-v2.5.4/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>
<form class="layui-form">
    <div class="layui-form-item ">
        <label class="layui-form-label">产品类别:</label>
        <div class="layui-input-inline ">
            <select id="productType" lay-filter="productTypeFilter">
                <option value="">--请选择--</option>
            </select>
        </div>
        <div class="layui-form-label">产品名称:</div>
        <div class="layui-input-inline ">
            <select id="productName" lay-filter="productNameFilter">
                <option value="">--请选择--</option>
            </select>
        </div>
        <div class="layui-form-label">产品产地:</div>
        <div class="layui-input-inline " >
            <select id="productArea" lay-filter="productAreaFilter">
                <option value="">--请选择--</option>
            </select>
        </div>
        <div class="layui-form-label">产品年份:</div>
        <div class="layui-input-inline ">
            <select id="productYear" lay-filter="productYearFilter">
                <option value="">--请选择--</option>
            </select>
        </div>
        <div class="layui-form-label">进货价格:</div>
        <input type="text" id="inPrice" class="layui-input">
        <div class="layui-form-label">出货价格:</div>
        <input type="text" id="outPrice" class="layui-input">
        <div class="layui-form-label">购买数量:</div>
        <input type="text" id="buynum" class="layui-input">
    </div>
</form>
<script src="../lib/layui-v2.5.4/layui.js" charset="utf-8">
</script>
<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="../js/addProducttoOrder.js"></script>
<script>
    //   getValue属于window对象
    function getValue() {
        let productType = $('#productType option:selected').val();
        let productId = $('#productName option:selected').val().split('#')[0];
        let productArea = $('#productArea option:selected').val();
        let productYear = $('#productYear option:selected').val();
        let inprice = $('#inPrice').val();
        let outprice = $('#outPrice').val();
        let buynum = $('#buynum').val();
        let data = {
            "rId": 0,
            "pId": productId,
            "yId": productYear,
            "xPrice": outprice,
            "xCount": buynum,
        };
        return data;
    }
</script>
</body>
</html>